package com.example.library_common.db;

import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.room.ColumnInfo;
import androidx.room.Embedded;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

import com.example.library_common.R;
import com.example.library_common.global.AppGlobals;

import java.util.ArrayList;
import java.util.List;

@Entity(tableName = "user_info")
public class User {


    /**
     * uid : 10003
     * nickname : 社会你威哥
     * avatar_url : /H5/images/tx.jpg
     * real_name :
     * mobile : 15197762033
     * balance : 0.00
     * frozen_money : 0.00
     * sex : 0
     * invite_code : 005939
     * vip_level : 0
     * agent_level : 0
     * username : 14606942
     * level_text : lv1入门
     * agent_level_text : 无
     * see_day_num : 0
     * invit_count : 0
     * sex_label : 男
     * app_download_url : https://cehsishiyuu.oss-cn-chengdu.aliyuncs.com/a11.apk
     * download_qrcode : /Uploads/Qrcode/08/080709cbb20af7cf971aa37de48943fe_1_10_1.png
     * pop_group : https://tb.53kf.com/code/client/10118013/1
     * customer_url : https://tb.53kf.com/code/client/10118013/1
     * qrcode_url : ./images/dd.png
     * qrcode : [{"id":"1","title":"123"}]
     * is_sign : 0
     */
    public User() {
        this.api_token = "";
        qrcode =new ArrayList<>();
    }

    public User(@NonNull String api_token) {
        this.api_token = api_token;
        qrcode =new ArrayList<>();
    }

    @PrimaryKey
    @NonNull
    @ColumnInfo(name = "api_token", defaultValue = "")
    private String api_token;

    @ColumnInfo(name = "user_id")
    private String uid;


    //用户名
    @ColumnInfo(name = "nickname", defaultValue = "")
    private String nickname;

    //头像地址
    @ColumnInfo(name = "avatar_url", defaultValue = "")
    private String avatar_url;

    //真实姓名
    @ColumnInfo(name = "real_name", defaultValue = "")
    private String real_name;

    //手机号
    @ColumnInfo(name = "mobile", defaultValue = "")
    private String mobile;

    //余额
    @ColumnInfo(name = "balance", defaultValue = "")
    private String balance;

    //冻结金额
    @ColumnInfo(name = "frozen_money", defaultValue = "")
    private String frozen_money;

    //性别
    @ColumnInfo(name = "sex", defaultValue = "")
    private String sex;

    //性别
    @ColumnInfo(name = "sex_label", defaultValue = "")
    private String sex_label;

    //邀请码
    @ColumnInfo(name = "invite_code", defaultValue = "")
    private String invite_code;

    //会员级别
    @ColumnInfo(name = "vip_level", defaultValue = "")
    private String vip_level;

    //代理级别
    @ColumnInfo(name = "agent_level", defaultValue = "")
    private String agent_level;

    //代理级别
    @ColumnInfo(name = "agent_level_text", defaultValue = "")
    private String agent_level_text;

    //用户名
    @ColumnInfo(name = "username", defaultValue = "")
    private String username;

    //会员级别
    @ColumnInfo(name = "level_text", defaultValue = "")
    private String level_text;

    //观影天数
    @ColumnInfo(name = "see_day_num", defaultValue = "")
    private int see_day_num;

    //邀请人数
    @ColumnInfo(name = "invit_count")
    private int invit_count;

    //app下载地址
    @ColumnInfo(name = "app_download_url", defaultValue = "")
    private String app_download_url;

    //下载二维码
    @ColumnInfo(name = "download_qrcode", defaultValue = "")
    private String download_qrcode;

    //pop交流群
    @ColumnInfo(name = "pop_group", defaultValue = "")
    private String pop_group;

    //客服地址
    @ColumnInfo(name = "customer_url", defaultValue = "")
    private String customer_url;

    //二维码背景图url
    @ColumnInfo(name = "qrcode_url", defaultValue = "")
    private String qrcode_url;

    //签到状态
    @ColumnInfo(name = "is_sign", defaultValue = "")
    private int is_sign;

    @Ignore
    private List<QRCodeBean> qrcode =new ArrayList<>();

    public List<QRCodeBean> getQrcode() {
        return qrcode;
    }

    public void setQrcode(List<QRCodeBean> qrcode) {
        this.qrcode = qrcode;
    }

    public String getApi_token() {
        return api_token;
    }

    public void setApi_token(String api_token) {
        this.api_token = api_token;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar_url() {
        return TextUtils.isEmpty(avatar_url) ?
                AppGlobals.getApplication().getString(R.string.defaults_img):avatar_url;
    }

    public void setAvatar_url(String avatar_url) {
        this.avatar_url = avatar_url;
    }

    public String getReal_name() {
        return real_name;
    }

    public void setReal_name(String real_name) {
        this.real_name = real_name;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getBalance() {
        return balance;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getFrozen_money() {
        return frozen_money;
    }

    public void setFrozen_money(String frozen_money) {
        this.frozen_money = frozen_money;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getInvite_code() {
        return invite_code;
    }

    public void setInvite_code(String invite_code) {
        this.invite_code = invite_code;
    }

    public String getVip_level() {
        return vip_level;
    }

    public void setVip_level(String vip_level) {
        this.vip_level = vip_level;
    }

    public String getAgent_level() {
        return agent_level;
    }

    public void setAgent_level(String agent_level) {
        this.agent_level = agent_level;
    }

    public String getUsername() {
        return username;
    }

    public String getUsernameStr() {
        return "账号："+username;
    }





    public void setUsername(String username) {
        this.username = username;
    }

    public String getLevel_text() {
        return level_text;
    }

    public void setLevel_text(String level_text) {
        this.level_text = level_text;
    }

    public String getAgent_level_text() {
        return agent_level_text;
    }

    public void setAgent_level_text(String agent_level_text) {
        this.agent_level_text = agent_level_text;
    }

    public int getSee_day_num() {
        return see_day_num;
    }

    public String getSeeDayNum() {
        return String.valueOf(see_day_num) ;
    }

    public void setSee_day_num(int see_day_num) {
        this.see_day_num = see_day_num;
    }

    public int getInvit_count() {
        return invit_count;
    }

    public String getInviteCount() {
        return String.valueOf(invit_count) ;
    }

    public void setInvit_count(int invit_count) {
        this.invit_count = invit_count;
    }

    public String getSex_label() {
        return sex_label;
    }

    public void setSex_label(String sex_label) {
        this.sex_label = sex_label;
    }

    public String getApp_download_url() {
        return app_download_url;
    }

    public void setApp_download_url(String app_download_url) {
        this.app_download_url = app_download_url;
    }

    public String getDownload_qrcode() {
        return download_qrcode;
    }

    public void setDownload_qrcode(String download_qrcode) {
        this.download_qrcode = download_qrcode;
    }

    public String getPop_group() {
        return pop_group;
    }

    public void setPop_group(String pop_group) {
        this.pop_group = pop_group;
    }

    public String getCustomer_url() {
        return customer_url;
    }

    public void setCustomer_url(String customer_url) {
        this.customer_url = customer_url;
    }

    public String getQrcode_url() {
        return qrcode_url;
    }

    public void setQrcode_url(String qrcode_url) {
        this.qrcode_url = qrcode_url;
    }

    public int getIs_sign() {
        return is_sign;
    }

    public void setIs_sign(int is_sign) {
        this.is_sign = is_sign;
    }




}
